
	var repair = echarts.init(document.getElementById('repair'));
//var colorList =['#228c38', '#1a57b2', '#b04b07', '#af8108'];
var colorList =["#f6d54a","#f69846","#44aff0","#45dbf7","#f845f1","#ad46f3","#5045f6","#4777f5"];
var colorListSub =['rgba(35,143,56,.5)', 'rgba(26,87,178,.5)', 'rgba(176,75,7,.5)', 'rgba(175,129,8,.5)'];
function chart2(data) {
    return {
        tooltip: {
            trigger: 'item',
            // formatter: "{b}:({d}%)"
            formatter:function(param){
               return param.name +':'+ param.value;
            },
        },
        grid:{
            top: '0%',
        },
        legend: {
            orient: 'horizontal',
            textStyle:{
                color:'#fff'
            },
            left:'center',
            bottom:'8%',
            data:data.xdata
        },
        series: [
            {
                type:'pie',
                radius: [20, '56%'],
                center:["50%","38%"],
                roseType: 'radius',
                clockwise :false,
                z:10,
                itemStyle: {
                    normal: {
                        color: function(params) {
                            // build a color map as your need.
                            return colorList[params.dataIndex]
                        },
                        shadowBlur: 20,
                        shadowColor: 'rgba(0, 0, 0, 0.3)'
                    }
                },
                label: {
                    normal: {
                        formatter: function(param){
                            //console.log(param.percent,"param")
                            return Math.round(param.percent)+"%"
                        },
                        textStyle: {
                            backgroundColor:"rgba(3,48,85,0.6)",
                            padding:6
                        }
                    }
                },
                labelLine: {
                    normal: {
                        length: 10,
                        length2: 10,
                        lineStyle:{
                            width:1
                        }
                    }
                },
                data:data.ydata
            },

            // 中心的圆圈
            {
                radius: ['60%', '62%'],
                center:["50%","38%"],
                color:'#FFFFFF',
                type: 'pie',
                label: {
                    normal: {
                        show: false
                    },
                    emphasis: {
                        show: false
                    }
                },
                labelLine: {
                    normal: {
                        show: false
                    },
                    emphasis: {
                        show: false
                    }
                },
                tooltip: {
                    show: false
                },
                data: [{
                    value: data.count,
                    name: '告警总数',
                    itemStyle: {
                        normal: {
                            color: '#5A96FF',
                        }
                    }
                }],
                animation: false
            }
        ]
    };
}


